package com.bt.springboot.web.controller;

import com.bt.springboot.common.result.Result;
import com.bt.springboot.web.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

/**
 * @author zkx
 * @Date 2023/12/4 10:51
 */
@RequestMapping("/user")
@RestController
public class UserController {

	@Autowired
	private UserService userService;


	@PostMapping("/code")
	public Result sendCode(@RequestParam("phone") String phone, HttpSession session){
		return  userService.sendCode(phone, session);
	}

	@GetMapping("/update")
	public Result update(){
		userService.updateUser();
		return Result.success();
	}
}
